<form name='frmCadastroCompra' id='frmCadastroCompra' class='form last-child tableForm'>
<fieldset id='fieldset-compra' class="grey-bg first-child last-child fieldset-with-legend fieldset-with-legend-first-child">
<legend>Dados da compra</legend>
    <table border="0" width='100%'>
        <tr>
        <th width='150px'><label for='nota fiscal'>Nota Fiscal:</label></th>
        <td><?php echo $this->formText('nu_nota')?></td>


        <th width='150px'><label for='tipo de compra'>Tipo de Compra:</label></th>
        <td><?php echo $this->formSelect('co_tipo_compra',''
                                        ,array('class'=>'row cf'),$this->arTipoCompra);?></td>
        </tr>
        <tr>
           <th width='150px'><label for='fornecedor'>Fornecedor:</label></th>
           <td colspan='2'>
           <?php echo $this->formSelect('co_fornecedor',''
                                    ,array('class'=>'row cf','style'=>'float: left'),$this->arFornecedor);
                 echo $this->formButton('adicionar_fornecedor','Adicionar');                                    
           ?>           
           </td>            
        </tr>                
        <tr>
            <th><label for="cnpj">CNPJ:</label></th>
            <td><?php echo $this->formText('cnpj','',array('size'=>'20px','disabled'=>'disabled'))?></td>
            <th><label for="inscrição estadual">Inscrição Estadual:</label></th>
            <td><?php echo $this->formText('inscricao','',array('size'=>'30px','disabled'=>'disabled'))?></td>
        </tr>
        <tr>
            <th><label for='endereço'>Endereço:</label></th>
            <td colspan='3'><?php echo $this->formText('endereco','',array('size'=>'100px','disabled'=>'disabled'))?></td>
        </tr>
        <tr>
            <th><label for="telefone">Telefone:</label></th>
            <td><?php echo $this->formText('telefone','',array('size'=>'30px','disabled'=>'disabled'))?></td>
            <th><label for="representante">Representante:</label></th>
            <td><?php echo $this->formText('representante','',array('size'=>'40px','disabled'=>'disabled'))?></td>
        </tr>
    </table>
</fieldset>
<fieldset id='fieldset-Itens' class="grey-bg first-child last-child fieldset-with-legend fieldset-with-legend-first-child">
<legend>Itens de compra</legend>
<div>
<table border="0" width='100%'>
    <tr>
        <th width="5%"><label for="Produto">Produto:</label></th>
        <td width="10%"><?php echo $this->formSelect('produto','',array('class'=>'campo_adicionar'),$this->arProduto)?></td>
        <th width="5%"><label for="Quantidade">Quantidade:</label></th>
        <td width="5%"><?php echo $this->formText('quantidade','',array('size'=>'5','class'=>'campo_adicionar') )?></td>
        <!--
        <th width="5%"><label for="Unidade">Unidade:</label></th>
        <td width="5%"><?php echo $this->formText('unidade','',array('size'=>'5','class'=>'integer campo_adicionar'))?></td>
        -->
        <th width="5%"><label for="lote">Lote:</label></th>
        <td width="5%"><?php echo $this->formText('lote','',array('size'=>'5','class'=>'campo_adicionar'))?></td>
        <th width="15%"><label for="Valor Unitário">Valor Unitário:</label></th>
        <td width="10%"><?php echo $this->formText('valor','',array('size'=>'10','class'=>'campo_adicionar'))?></td>
        <td width="15%" align='right'><?php echo $this->formButton('adicionar_item','Adicionar');?></td>
    </tr>        
</table> 
</div> 
<p></p>
<div>
<table width='100%' id='lista_produto' class='table'>
    <thead>
    <tr>
        <th>Produto</th>
        <th>Lote</th>
        <th>Quantidade</th>        
  <!--       <th>Unidade(s)</th>        --> 
        <th>Valor Unitário</th>
        <th>Valor Total</th>
        <th></th>
    </tr>
    </thead>
    <tbody id='item_compra'>
    </tbody>
    <tfoot>
        <tr><th colspan="5">Total</th><td colspan='2' id='total_compra'></td></tfoot>
</table>
</div>
<div style='padding: 5px;'>
    <?php 
       echo $this->formButton('btSalvarCompra','Salvar',array('style'=>'float:right'));
       echo $this->formButton('btnCancelar','Cancelar',array('style'=>'float:left'))
     ?>
</div>
</form>
<script type="text/javascript" src="<?php echo PATH_JS?>modelo/fornecedor.js"></script>
<script type="text/javascript" src="<?php echo PATH_JS?>modelo/itemCompra.js"></script>
<script type="text/javascript" src="<?php echo PATH_JS?>modelo/compra.js"></script>
<script type="text/javascript" src="<?php echo PATH_JS?>eventos/compra.js"></script>
<script type="text/javascript" src="<?php echo PATH_JS?>eventos/fornecedor.js"></script>
<script type="text/javascript">$().ready(function(){ Eventos_Compra.iniciarEventosCompra();});</script>